package com.yunfangdata.query;

import org.springframework.format.annotation.DateTimeFormat;

import java.beans.ConstructorProperties;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

public class ChartQueryObject {
    @DateTimeFormat(
            pattern = "yyyy-MM-dd"
    )
    private Date beginDate;
    @DateTimeFormat(
            pattern = "yyyy-MM-dd"
    )
    private Date endDate;
    private String keyword;
    private String groupType = "off.name";
    public static final List<TypeObj> grouptypes = new LinkedList();

    public Date getBeginDate() {
        return this.beginDate;
    }

    public Date getEndDate() {
        return this.endDate;
    }

    public String getKeyword() {
        return this.keyword;
    }

    public String getGroupType() {
        return this.groupType;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public void setGroupType(String groupType) {
        this.groupType = groupType;
    }

    public ChartQueryObject() {
    }

    @ConstructorProperties({"beginDate", "endDate", "keyword", "groupType"})
    public ChartQueryObject(Date beginDate, Date endDate, String keyword, String groupType) {
        this.beginDate = beginDate;
        this.endDate = endDate;
        this.keyword = keyword;
        this.groupType = groupType;
    }

    static {
        grouptypes.add(new ChartQueryObject.TypeObj("off.name", "正式学员"));
        grouptypes.add(new ChartQueryObject.TypeObj("dd.name", "客户来源"));
        grouptypes.add(new ChartQueryObject.TypeObj("da.name", "支付方式"));
    }

    private static class TypeObj {
        private String type;
        private String typeName;

        public TypeObj(String type, String typeName) {
            this.type = type;
            this.typeName = typeName;
        }

        public String getType() {
            return this.type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }
    }
}
